/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package AccesoDatos.Persistencia.Entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author sebaxtian
 */
@Entity
@Table(name = "AREA")
@NamedQueries({
    @NamedQuery(name = "EArea.findAll", query = "SELECT e FROM EArea e"),
    @NamedQuery(name = "EArea.findByCodigoarea", query = "SELECT e FROM EArea e WHERE e.codigoarea = :codigoarea"),
    @NamedQuery(name = "EArea.findByCodigoareapadre", query = "SELECT e FROM EArea e WHERE e.codigoareapadre = :codigoareapadre"),
    @NamedQuery(name = "EArea.findByNombre", query = "SELECT e FROM EArea e WHERE e.nombre = :nombre"),
    @NamedQuery(name = "EArea.findByDescripcion", query = "SELECT e FROM EArea e WHERE e.descripcion = :descripcion")})
public class EArea implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CODIGOAREA")
    private Integer codigoarea;
    @Column(name = "CODIGOAREAPADRE")
    private Integer codigoareapadre;
    @Basic(optional = false)
    @Column(name = "NOMBRE")
    private String nombre;
    @Column(name = "DESCRIPCION")
    private String descripcion;

    public EArea() {
    }

    public EArea(Integer codigoarea) {
        this.codigoarea = codigoarea;
    }

    public EArea(Integer codigoarea, String nombre) {
        this.codigoarea = codigoarea;
        this.nombre = nombre;
    }

    public Integer getCodigoarea() {
        return codigoarea;
    }

    public void setCodigoarea(Integer codigoarea) {
        this.codigoarea = codigoarea;
    }

    public Integer getCodigoareapadre() {
        return codigoareapadre;
    }

    public void setCodigoareapadre(Integer codigoareapadre) {
        this.codigoareapadre = codigoareapadre;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigoarea != null ? codigoarea.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EArea)) {
            return false;
        }
        EArea other = (EArea) object;
        if ((this.codigoarea == null && other.codigoarea != null) || (this.codigoarea != null && !this.codigoarea.equals(other.codigoarea))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "AccesoDatos.Persistencia.Entidad.EArea[codigoarea=" + codigoarea + "]";
    }

}
